<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //访问器的属性(高于)对象定义的属性
        //
    //     let user={
    //        user_img:[ 
    //              {name:"js",grade:80},
    //              {name:"css",grade:70},
    //              {name:"mysql",grade:79}
    //        ],
          
    //        get name(){
    //             return  this.user_img.filter(item=>  item.grade>=79);
    //        },
    //        get avg(){
    //             return (this.user_img.reduce((p,c)=>p+=c.grade,0))/this.user_img.length ;
    //        }
    //     }
    //  console.log(user.name);
    // //  user.avg=5888; //不受影响
    //     console.log(user.avg);
       


    //批量设置对象的属性·
    let web={
         name:"唐玮",
         age:22,
         set user_info([...args]){
            // console.log(info);  
            // console.log([...args]);
            [this.name,this.age]=[...args];
           

         },
         get user_info(){
            return `${this.name}:${this.age}`;
         }
    };

    //一定要注意:设置是传入值，不是设置方法！！！害
web.user_info=["sb",250];
  
    console.log(web.user_info);

    </script>
</body>
</html>